<h2><?= esc($title) ?></h2>

<?php if ($news_list !== []): ?>

    <?php foreach ($news_list as $news_item): ?>

        <h3><?= esc($news_item['title']) ?></h3>

        <div class="main">
            <?= esc($news_item['body']) ?>
        </div>
    <!-- <p><a href="news/<?= $news_item['slug'] ?>">read more</a></p>  
    <p>  
        <a href="news/<?= $news_item['id'] ?>">redact</a> |   
        <a href="news/delete/<?= $news_item['id'] ?>" onclick="return confirm('Are you sure you want to delete this item?')">delete</a>  
    </p>   -->

        <p><a href="/news/<?= esc($news_item['slug'], 'url') ?>">View article</a></p>

        
        <p>  
    <a href="/news/<?= esc($news_item['slug'], 'url') ?>">View article</a> |  
    <a href="/news/delete/<?= esc($news_item['id']) ?>" onclick="return confirm('Are you sure you want to delete this news item?')">Delete</a>  
</p>  
 

    <?php endforeach ?>

<?php else: ?>

    <h3>No News</h3>

    <p>Unable to find any news for you.</p>

<?php endif ?>

